package com.djnt.catering.database;

import java.util.HashMap;

import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.provider.BaseColumns;

public class CompanyUsers implements BaseColumns {

	static final String TABLE_NAME = "company_users";

	/**
	 * The content:// style URL for this table
	 */
	public static final Uri CONTENT_URI = Uri.parse("content://"
			+ CateringProvider.AUTHORITY + "/" + TABLE_NAME);

	public static final String LOGO = "logo";
	public static final String USER = "user";
	public static final String COMPANY_NAME = "company_name";
	public static final String COMPANY_ADDRESS = "company_address";
	public static final String COMPANY_ZIPCODE = "company_zipcode";
	public static final String COMPANY_HOMEPAGE = "company_homepage";
	public static final String COMPANY_PHONE = "company_phone";
	public static final String COMPANY_PORTRAITURE = "company_portraiture";
	public static final String CONTACT_NAME = "contact_name";
	public static final String CONTACT_PHONE = "contact_phone";
	public static final String CONTACT_EMAIL = "contact_email";

	public static void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + _ID
				+ " INTEGER PRIMARY KEY," + USER + " TEXT," + COMPANY_NAME
				+ " TEXT," + COMPANY_ADDRESS + " TEXT," + COMPANY_ZIPCODE
				+ " INTEGER," + COMPANY_HOMEPAGE + " TEXT," + COMPANY_PHONE
				+ " TEXT," + COMPANY_PORTRAITURE + " TEXT," + CONTACT_NAME
				+ " TEXT," + CONTACT_PHONE + " TEXT," + CONTACT_EMAIL
				+ " TEXT," + LOGO + " TEXT" + ");");

	}

	public static HashMap<String, String> PROJECTION_MAP = new HashMap<String, String>();
	static {
		PROJECTION_MAP.put(_ID, _ID);
		PROJECTION_MAP.put(LOGO, LOGO);
		PROJECTION_MAP.put(USER, USER);
		PROJECTION_MAP.put(COMPANY_NAME, COMPANY_NAME);
		PROJECTION_MAP.put(COMPANY_ADDRESS, COMPANY_ADDRESS);
		PROJECTION_MAP.put(COMPANY_ZIPCODE, COMPANY_ZIPCODE);
		PROJECTION_MAP.put(COMPANY_HOMEPAGE, COMPANY_HOMEPAGE);
		PROJECTION_MAP.put(COMPANY_PHONE, COMPANY_PHONE);
		PROJECTION_MAP.put(COMPANY_PORTRAITURE, COMPANY_PORTRAITURE);
		PROJECTION_MAP.put(CONTACT_NAME, CONTACT_NAME);
		PROJECTION_MAP.put(CONTACT_PHONE, CONTACT_PHONE);
		PROJECTION_MAP.put(CONTACT_EMAIL, CONTACT_EMAIL);
		UriMatcherCode.addURI(TABLE_NAME, UriMatcherCode.COMPANY_USERS);

	}
}
